﻿using System.Web;
using System.Web.Routing;

namespace Smarly.Web.RouteConstraints
{
	public class ExtentionRouteConstraint : IRouteConstraint
	{
		public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values,
		                  RouteDirection routeDirection)
		{
			return values["parts"].ToString().EndsWith("." + values[parameterName]);
		}
	}
}